Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated ConnectionWatchdog #1132

Closed

Conversation

mors741
Copy link

@mors741 mors741 commented Sep 23, 2019

In io.lettuce.core.ConnectionBuilder#buildHandlers these lines of codes are duplicated:

if (clientOptions.isAutoReconnect()) {
    handlers.add(createConnectionWatchdog());
}

Channel pipeline looks like this:

0 = "PlainChannelInitializer#0"
1 = "channelActivator"
2 = "ChannelGroupListener#0"
3 = "CommandEncoder#0"
4 = "CommandHandler#0"
5 = "ConnectionWatchdog#0"
6 = "ConnectionEventTrigger#0"
7 = "ConnectionWatchdog#1"
8 = "DefaultChannelPipeline$TailContext#0"

More importantly ConnectionWatchdog#0 and ConnectionWatchdog#1 are actually the same instance.

I can see from #335 that ConnectionWatchdog is better to be the last handler.
So maybe the first creation can be removed?
Or if there is a sensible explanation for this, I can write an explaining comment.

@mp911de mp911de added the type: bug A general bug label Sep 24, 2019
@mp911de
Copy link
Collaborator

mp911de commented Sep 24, 2019

Thanks for report. Adding watchdog twice is a bug.

@mp911de mp911de added this to the 5.2.0 milestone Sep 24, 2019
mp911de pushed a commit that referenced this pull request Sep 25, 2019
mp911de pushed a commit that referenced this pull request Sep 25, 2019
@mp911de
Copy link
Collaborator

mp911de commented Sep 25, 2019

That's merged and backported now.

@mp911de mp911de closed this Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants